package com.denlaku.longan.repository;

import com.denlaku.longan.dao.MyFavorDao;
import com.denlaku.longan.qo.MyFavorQuery;
import com.denlaku.longan.vo.MyFavor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author tianx
 */
@Repository
public class MyFavorRepository {
    @Autowired
    private MyFavorDao myFavorDao;

    /**
     * 添加我喜欢
     * @param myFavor 我喜欢
     */
    public void add(MyFavor myFavor) {
        myFavorDao.add(myFavor);
    }

    /**
     * 根据ID删除我喜欢
     * @param id id
     */
    public void delete(Long id) {
        myFavorDao.delete(id);
    }

    /**
     * 根据uid删除我喜欢
     * @param uid 用户id
     */
    public void deleteByUid(Long uid) {
        myFavorDao.deleteByUid(uid);
    }

    /**
     * 查询我喜欢
     * @param query 查询参数
     * @return 我喜欢
     */
    public List<MyFavor> list(MyFavorQuery query) {
        return myFavorDao.list(query);
    }
}
